<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/8/3
 * Time: 11:45
 */
defined('IN_PHPCMS') or exit('No permission resources.');
/**
 * 点击统计
 */
//www.zqtt.com/api.php?op=zhanyi
$db = pc_base::load_model('news_model');//需要先新建一个news_model
$db1 = pc_base::load_model('news_data_model');
$start_time=time();
$rs1=$db1->select('','id,copyfrom_name,copyfrom_url','','id desc');
$i=0;
foreach($rs1 as $v){
    $where['id']=$v['id'];
    $data=array(
        "copyfrom_name1"=>$v['copyfrom_name'],
        "copyfrom_url1"=>$v['copyfrom_url'],
    );
    $news_id=$db->update($data,$where);
    $i++;
}
echo $i;
$end_time=time();
$time=$end_time-$start_time;
echo "<h3>共{$time}秒</h3>";
